package com.wlw.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.wlw.entity.Province;

import edu.xjsoft.base.service.DefaultEntityManager;

@Service
@Transactional
public class ProvinceService extends DefaultEntityManager<Province> {

	/**
	 *	目的地导航：（国内）
	 */
	public List<Province> homeProvince(){
		String hql = "select p from Province p";
		List<Province> homeProvinces = getEntityDao().find(hql);
		return homeProvinces;
	}
	/**
	 * 攻略导航（西部、中部、东部）
	 * 
	 */
	public List<Province> xiBuProvinces() {
		String hql = "select p from Province p where p.direction=?";
		List<Province> provinces = getEntityDao().find(hql, "西部");
		return provinces;
	}
	public List<Province> zhongBuProvinces() {
		String hql = "select p from Province p where p.direction=?";
		List<Province> provinces = getEntityDao().find(hql, "中部");
		return provinces;
	}
	public List<Province> DongBuProvinces() {
		String hql = "select p from Province p where p.direction=?";
		List<Province> provinces = getEntityDao().find(hql, "东部");
		return provinces;
	}
}
